package main

/*******************************************************************************
Copyright:cloud
Author:cloudapex@126.com
Version:1.0
Date:2014-10-18
Description:属性定义
	1 服务类型
	2 服务命令
	2 服务事件
	3 常量定义
	4 数据结构
*******************************************************************************/
import (
	"Ghost/mss"
	. "Ghost/utd"
	"time"
)

var (
	LoginHost = TStringArray{"127.0.0.1:10100"}
)

//------------------------------------------------------------------------------
//==================================常量定义====================================
//------------------------------------------------------------------------------
const (
	DEF_LOGIC_GAP_TIME     = 5 * time.Second
	DEF_ACCOUNT_PREFIX     = "cloud"
	DEF_ACCOUNT_PASSWORD   = "111111"
	DEF_ROBOT_RATE         = 1
	DEF_ROBOT_CAPY         = 100
	DEF_CLIENT_RECONN_TIME = 5 * time.Second
	DEF_CLIENT_CHAN_SIZE   = 100
	SID_ROBOT_BEGIN        = 10000
)
const (
	SID_ROBOT_IN    = mss.DEF_SERVICE_BEGIN_ID + iota
	SID_CMD_CONSOLE // 控制台服务
	SID_ROBOT_EX
)

func init() {
	mss.SetSvieName(SID_CMD_CONSOLE, "SID_CMD_CONSOLE")
}

const (
	CID_ROBOT_IN = mss.DEF_CONTROL_BEGIN_ID + iota
	CID_CONTROL  // 主控制器
	CID_ROBOT_EX
)

func init() {
	mss.SetCtrlName(CID_CONTROL, "CID_CONTROL")
}

//------------------------------------------------------------------------------
//==================================类型定义====================================
//------------------------------------------------------------------------------
// => 机器人状态
type ERobotState int //
const (
	ERS_Login ERobotState = iota + 1
	ERS_Lobby
	ERS_Scene
) //
func (e ERobotState) String() string {
	switch e {
	case ERS_Login:
		return "ERS_Login"
	case ERS_Lobby:
		return "ERS_Lobby"
	case ERS_Scene:
		return "ERS_Scene"
	}
	return "ERS_Unknow"
}
